UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yjGMe8I7iTyVKa2o+n/HuBfpuDZSwBkXovMrjZlSgSs=' 
WHERE 
  key_id = 'a3e08347ac28a774ef89f1b152cf162de798d02e8e07cc4e6a24bcaf28f555e3' 
  AND (
    token = 'yjGMe8I7iTyVKa2o+n/HuBfpuDZSwBkXovMrjZlSgSs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022