UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'apLj+g31ypLBHHyyER0mx5kyOFVPl6Rre0Umfota9tA='
WHERE
key_id = 'c89f940b5b7b85d9741f2634578e8f43d918086ff3f91b3788ff718a66e713f7'
AND (
token = 'apLj+g31ypLBHHyyER0mx5kyOFVPl6Rre0Umfota9tA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)