UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Eg3RlW8WfchWSJV2usEm7GhgSbXoIoR4xwtpRJJ5Rzw='
WHERE
key_id = 'd42e64766a6139931db5afc78b201473d9244df5a358bade4ce4f7b1a4673e9e'
AND (
token = 'Eg3RlW8WfchWSJV2usEm7GhgSbXoIoR4xwtpRJJ5Rzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)