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