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