UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UKyi+0faN1S95mrk3MFJtWZQKENtTizEYp/0OhcZLMM='
WHERE
key_id = '8ea5a212067878af775464b20437d1223c565e2f9b7a2b5cc77c60fb23c69036'
AND (
token = 'UKyi+0faN1S95mrk3MFJtWZQKENtTizEYp/0OhcZLMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)