UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XxLi2CvrJ/jRM9wcxShGGwUSL1sfvGAU0NWjQoLWcpA='
WHERE
key_id = '47289acae8cdcc7ae30835833dc31630bde13631a9e81629fd1e62db53b713eb'
AND (
token = 'XxLi2CvrJ/jRM9wcxShGGwUSL1sfvGAU0NWjQoLWcpA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)