UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fV88J6c2Pm1w7QSXuB6A2H/fOhBY47iBxEiWvIH2W9U='
WHERE
key_id = 'a31eb774a6e0151b7f1a6c6e2f187c55cda0202402bbca4c424495823d4e7221'
AND (
token = 'fV88J6c2Pm1w7QSXuB6A2H/fOhBY47iBxEiWvIH2W9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)