UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mIihapTOwnwy/C3mdFwG2Etn5C4GIhGQsi8wGEE6gy4=' 
WHERE 
  key_id = '93ddf51a9b458ccffbe21f74d32ce2cf189b5f98c056a0a8c69fccf92933f772' 
  AND (
    token = 'mIihapTOwnwy/C3mdFwG2Etn5C4GIhGQsi8wGEE6gy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031