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