UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BVexxrQtaJSeAhz/wAc0Fu9mUKoFkJWxQagO2JXbFeA=' 
WHERE 
  key_id = 'e0d8752afbf62b24c3790ea79e8a8e116ae610b5ca8cd4eb030b0b0b0e71a133' 
  AND (
    token = 'BVexxrQtaJSeAhz/wAc0Fu9mUKoFkJWxQagO2JXbFeA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042