UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p7/08rD/iNk1/y1apLXtyG+LAhe7d52Q2on0H5kjzVY=' 
WHERE 
  key_id = '3304cfbaf0ba76bed35ffd8d5371824781e337f76eed2d7694853daafe7aa6b2' 
  AND (
    token = 'p7/08rD/iNk1/y1apLXtyG+LAhe7d52Q2on0H5kjzVY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030