UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OAlcEYD5TzIpLXT1TOSWg1mBWB/lk/aI+5uP4YkWQdc='
WHERE
key_id = '5e15164cb4032ca14920626e78db6d8bcb6355977bea7a90d55c8b141d691e7a'
AND (
token = 'OAlcEYD5TzIpLXT1TOSWg1mBWB/lk/aI+5uP4YkWQdc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)