UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hcTZLs22hpf4q+6bhNZFwBWBOa+GMzbk09itGvQmKHQ='
WHERE
key_id = '7b1f790681d32fa9ae5895ecde6a7a0bd9449edecb12191e486a60530eadfeac'
AND (
token = 'hcTZLs22hpf4q+6bhNZFwBWBOa+GMzbk09itGvQmKHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)