UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UjafzvlDy4ZPB4zBIlfkWs5aJI0WvRwvCnLoaZxxsjY=' 
WHERE 
  key_id = 'f302fb19b7d7cd32a5f58fb26219876b388cb9e4ade56b922f49a4b72cba3d44' 
  AND (
    token = 'UjafzvlDy4ZPB4zBIlfkWs5aJI0WvRwvCnLoaZxxsjY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030