UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KNV9YY7bJtpda6WtGZhnzOX+LlQwSiq9UD42jQ7oHPM='
WHERE
key_id = '76aa5cbc490d6ba74311fb97666e52b8a9ea6033217d4954297a8134fc51a2a8'
AND (
token = 'KNV9YY7bJtpda6WtGZhnzOX+LlQwSiq9UD42jQ7oHPM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)