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