UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'taFnqNnPawPeW7LUdn6I/RFJrcz/lN6r40xh5+BTaNc=' 
WHERE 
  key_id = '3985fe0464504f302aea16d5c297295df56ec44a199da58de599833dfb0eac09' 
  AND (
    token = 'taFnqNnPawPeW7LUdn6I/RFJrcz/lN6r40xh5+BTaNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044