UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OYU/Np6Y8NW2aMfVdyff95elNiTBLkSRvoi2UmQB6sY=' 
WHERE 
  key_id = 'bdc94f27a4b21b2c67a4a6136c489784cc3ef4079571b4273db9e3e1fc3f3a3e' 
  AND (
    token = 'OYU/Np6Y8NW2aMfVdyff95elNiTBLkSRvoi2UmQB6sY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037