UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nbF5G+7gDUQN1ZFxe3myFs835LW/izfVQ6ZLmxG/AJw=' 
WHERE 
  key_id = '03f76f4d5ad6640d0fa5e2837beff12b6166eef003918a7490dd935ff105ed5c' 
  AND (
    token = 'nbF5G+7gDUQN1ZFxe3myFs835LW/izfVQ6ZLmxG/AJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017