UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DjmnNyjudmuRzYfSh0E+vn+3oYdxDK+qGRYc/oUJdbE='
WHERE
key_id = 'a521bcbf58a81426aee4f19cff95403306c24e72556487c4abfe58cd2ef7ab1b'
AND (
token = 'DjmnNyjudmuRzYfSh0E+vn+3oYdxDK+qGRYc/oUJdbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)