UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g90Iubq7FXmZQ8HQ5VZtoSOhxSbzN3WHMPRyUkzVnDg='
WHERE
key_id = '6b3154a7955f8d483f60850404e34062e4ef04cae32626d3eb0d059813d08d1c'
AND (
token = 'g90Iubq7FXmZQ8HQ5VZtoSOhxSbzN3WHMPRyUkzVnDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)