UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kZe4HOMj5IZbHPIiexUwgUbFFOCK86E8ENwSh/KReYU='
WHERE
key_id = '0cfe865cb03d95fc3e9d3cad1e5cc1707de4a589b01e3a9034b3f911815ffd9a'
AND (
token = 'kZe4HOMj5IZbHPIiexUwgUbFFOCK86E8ENwSh/KReYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)