UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+Oi9eLAux3f62tTV1Q/A1KMEsRB/X2lPCZGbdIF4EI='
WHERE
key_id = '4fcf3b3fd1c08e998e3f3d9392d782faf7f073f34113b76ab389a6de1de667eb'
AND (
token = 'M+Oi9eLAux3f62tTV1Q/A1KMEsRB/X2lPCZGbdIF4EI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)