UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '576yxIhGCMh5OMCgffuM8vDYcQOXxzQzrG81QPJN7p8='
WHERE
key_id = '5c58b49c9fa58a6ed8af171d7a3eb86cf39cabcb39d28c12e913c6a9191e66f8'
AND (
token = '576yxIhGCMh5OMCgffuM8vDYcQOXxzQzrG81QPJN7p8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)