UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IBwrQTSnmX0otH+/oiNV6NwwdTETCb30y3Jw7L4o+yg=' 
WHERE 
  key_id = '5e0d54995a8935a5ced6f0f32e48785e7d26527149cffdbabed5d880510c0a4d' 
  AND (
    token = 'IBwrQTSnmX0otH+/oiNV6NwwdTETCb30y3Jw7L4o+yg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032