UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i+/eJ5WTtEFo7T0/YKzCPnD6CuLBVpPHboOmbv9tpDM='
WHERE
key_id = '0959d3a8760ae129b599c5c00df510e968125aefe10a8fbd32a09b4891543453'
AND (
token = 'i+/eJ5WTtEFo7T0/YKzCPnD6CuLBVpPHboOmbv9tpDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)