UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mvrfazV5McR2VnsXxM5mJ2zsTZgim/+y0Vtl3W93WcI='
WHERE
key_id = 'aeb5bd3c04b5d4515a9cb49af01a7adf780e4add891a060310edf7af72a7d119'
AND (
token = 'mvrfazV5McR2VnsXxM5mJ2zsTZgim/+y0Vtl3W93WcI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)