UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OxB4HgHliltuUjc4XWoB/Vz1oxXPWSfUAT1gy1/ygFw='
WHERE
key_id = '9be866fed83a52e1393633187b28315d49c145200af31daf72bdc501809eae43'
AND (
token = 'OxB4HgHliltuUjc4XWoB/Vz1oxXPWSfUAT1gy1/ygFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)