UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4gVLlr1S/3tojngQfmCfXxkbSijY8mhSGEco7ws/GUg=' 
WHERE 
  key_id = '45a8a594652e2c42bf22665aa8858c4b55ca79ae3b531933a4c6e85a4d5e8b91' 
  AND (
    token = '4gVLlr1S/3tojngQfmCfXxkbSijY8mhSGEco7ws/GUg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037