UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't4gywpRUhmQSlaNOY9p2qehOlBpBEDj75uqG6RdWCAo='
WHERE
key_id = '0fea77e89645383edb2ebb1f791c7b07acadbed3725c3e347eedcdb803e01efc'
AND (
token = 't4gywpRUhmQSlaNOY9p2qehOlBpBEDj75uqG6RdWCAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)