UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LrgmXYe64rRS1vo6Uj+K2GGrRH66ZRPhcoZ1KIIDbwA=' 
WHERE 
  key_id = '2441e40343f6debee1bcbd90bb525c79ebe374e4f01e3d5487d6c5afe409b917' 
  AND (
    token = 'LrgmXYe64rRS1vo6Uj+K2GGrRH66ZRPhcoZ1KIIDbwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033