UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nf7hZIQqKpY6f0K7jt3bEbjewuvBSnm7Lm6psO/H6lc=' 
WHERE 
  key_id = '3e21621eed057800d48a3c134fe0e7afbe218e80db6dad3886fa9832c3d211ca' 
  AND (
    token = 'Nf7hZIQqKpY6f0K7jt3bEbjewuvBSnm7Lm6psO/H6lc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026