UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2hUSxzY0yxM/fspGd5y7t+RUUCwC5Ro7b64c48+EU1M='
WHERE
key_id = 'ca5227b369409264449a1b5f9e72e4d685d3a7d1501da5ca89f281c4d58289b9'
AND (
token = '2hUSxzY0yxM/fspGd5y7t+RUUCwC5Ro7b64c48+EU1M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)