UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vjwoKhS3T8OxGtDnt5LkISYFLeDzfDReA1+K3CLSQJg='
WHERE
key_id = '22595e36b7da3f4834b10bd27d0210441cf9d3c76e12d7756c00cce7eaefc616'
AND (
token = 'vjwoKhS3T8OxGtDnt5LkISYFLeDzfDReA1+K3CLSQJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)