UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '24yAw8X2YVF1/1FiBqcc1tgZLBO8Mz0j5uVHK+o0Pbo=' 
WHERE 
  key_id = '3095441e5518e48585af6d73020f38d9f2eca67cea9aab1e6958e09542b60cd0' 
  AND (
    token = '24yAw8X2YVF1/1FiBqcc1tgZLBO8Mz0j5uVHK+o0Pbo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040