UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WcjkKsKPAxDdgeYv8YUT4InI7nO/+ImgZDWL99G0SxI='
WHERE
key_id = '9160ec6815a6e101530fc509af3e069a1f46856b534402d339e4b21bccc13146'
AND (
token = 'WcjkKsKPAxDdgeYv8YUT4InI7nO/+ImgZDWL99G0SxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)