UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8LLbiD4+xKKKlsOJo7nk4PJ0t0FkhmSzx3DGwGFkFCU='
WHERE
key_id = '31ae10e7ee82afed5b96e3c4e63f576c96dcd4a6cf10b7db84790852294d7d40'
AND (
token = '8LLbiD4+xKKKlsOJo7nk4PJ0t0FkhmSzx3DGwGFkFCU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)